From fb008da9665c3ac6b7cf09526c98923c098f631d Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Wed, 17 Aug 2005 12:25:50 +0000 Subject: [PATCH] Restore domains with a different uuid than they had. Needed for migration to localhost and migration between hosts with a shared/distributed xenstore. Signed-off-by: Christian Limpach --- tools/python/xen/xend/XendDomain.py | 3 +-- tools/python/xen/xend/XendDomainInfo.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/python/xen/xend/XendDomain.py b/tools/python/xen/xend/XendDomain.py index 2315aaea20..3959b2e917 100644 --- a/tools/python/xen/xend/XendDomain.py +++ b/tools/python/xen/xend/XendDomain.py @@ -320,8 +320,7 @@ class XendDomain: @param vmconfig: vm configuration """ config = sxp.child_value(vmconfig, 'config') - uuid = sxp.child_value(vmconfig, 'uuid') - dominfo = XendDomainInfo.restore(self.dbmap, config, uuid=uuid) + dominfo = XendDomainInfo.restore(self.dbmap, config) return dominfo def domain_restore(self, src, progress=False): diff --git a/tools/python/xen/xend/XendDomainInfo.py b/tools/python/xen/xend/XendDomainInfo.py index 570bb6dbda..4bacd19deb 100644 --- a/tools/python/xen/xend/XendDomainInfo.py +++ b/tools/python/xen/xend/XendDomainInfo.py @@ -195,13 +195,15 @@ class XendDomainInfo: recreate = classmethod(recreate) - def restore(cls, parentdb, config, uuid): + def restore(cls, parentdb, config, uuid=None): """Create a domain and a VM object to do a restore. @param parentdb: parent db @param config: domain configuration @param uuid: uuid to use """ + if not uuid: + uuid = getUuid() db = parentdb.addChild(uuid) vm = cls(db) ssidref = int(sxp.child_value(config, 'ssidref')) -- 2.30.2